import axios from 'axios'
import {observable,autorun,action,runInAction, configure} from 'mobx'
/*
const store=observable({
    isTabbarShow:true,
    list:[],
    cityName:"北京",
    changeShow(){
        this.isTabbarShow=true
    },
    changeHide(){
        this.isTabbarShow=false
    }
},{
    changeHide:action,
    changeShow:action//标记两个方法是action,专门修改可观察的value
})*/
configure({
    enforceActions:'always'
})
class Store{
    @observable isTabbarShow=true
    @observable list=[]
    @action changeShow(){
        this.isTabbarShow=true
    }
    @action changeHide(){
        this.isTabbarShow=false
    }
    @action getList(){
        axios({
            method:'GET',
            url:"https://m.maizuo.com/gateway?cityId=440300&ticketFlag=1&k=2005318",
            headers:{
                "X-Client-Info": '{"a":"3000","ch":"1002","v":"5.2.0","e":"1654433035923688551579649"}',
                "X-Host": "mall.film-ticket.cinema.list"
            }    
        }).then(res=>{
            runInAction(()=>{
                this.list=res.data.data.cinemas
            })
        })
    }
}
const store=new Store()
export default store